package pe.com.bbva.ge.domain.seguridad;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

import pe.com.bbva.ge.domain.base.Auditoria;
import pe.com.bbva.ge.domain.configuracion.Valor;

/**
 * The persistent class for the SEG_PERMISO database table.
 * 
 */
@Entity
@Table(name = "SEG_PERMISO")
public class Permiso extends Auditoria {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique = true, nullable = false, precision = 19)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "SEQ_PERMISO")
	@TableGenerator(name = "SEQ_PERMISO", table = Permiso.SEQ_TABLA, pkColumnName = Permiso.SEQ_TABLA_PK, initialValue = 1, valueColumnName = Permiso.SEQ_TABLA_COLUMN, pkColumnValue = "pe.com.bbva.ge.domain.seguridad.Permiso", allocationSize = 1)
	private long id;

	public long getId() {
		return this.id;
	}

	public void setId(long id) {
		this.id = id;
	}
	
	

	// uni-directional many-to-one association to Valor
	@ManyToOne
	@JoinColumn(name = "ESTADO")
	private Valor estado;

	// uni-directional many-to-one association to Opcion
	@ManyToOne
	@JoinColumn(name = "OPCION")
	private Opcion opcion;

	// bi-directional many-to-one association to Rol
	@ManyToOne
	@JoinColumn(name = "ROL")
	private Rol rol;

	public Opcion getOpcion() {
		return this.opcion;
	}

	public void setOpcion(Opcion opcion) {
		this.opcion = opcion;
	}

	public Rol getRol() {
		return this.rol;
	}

	public void setRol(Rol rol) {
		this.rol = rol;
	}

	public Valor getEstado() {
		return estado;
	}

	public void setEstado(Valor estado) {
		this.estado = estado;
	}

}